package com.imooc.course.business.controller.album;

import com.imooc.course.server.dto.ResponseDto;
import com.imooc.course.server.service.CategoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/album/category")
public class AlbumCategoryController {

    private static final Logger log = LoggerFactory.getLogger(AlbumCategoryController.class);
    public static final String BUSINESS_NAME = "Album Category";

    @Resource(name = "categoryService")
    private CategoryService categoryService;

    /**
     * 查询所有分类
     * @return
     */
    @PostMapping("/all")
    public ResponseDto getAll() {
        return ResponseDto.success().setContent(categoryService.getAll());
    }
}
